﻿




using System.Collections.Specialized;
using System.Web.Mvc;
using Hotpot.Modules.FormsAuthentication.Models;

namespace Hotpot.Modules.FormsAuthentication.ModelBinders
{
    public class UserChangePasswordInputModelBinder : IModelBinder
    {
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            NameValueCollection form = controllerContext.HttpContext.Request.Form;

            string password = form["userPassword"];
            string passwordConfirm = form["userPasswordConfirm"];

            return new UserChangePasswordInput(password, passwordConfirm);
        }
    }
}
